from abc import ABCMeta, abstractmethod, abstractproperty
from PyQt5.QtCore import pyqtSignal
from PyQt5.QtWidgets import QDockWidget, QWidget, QMainWindow

'''
UI 的基础类
'''


class AbstractMainForm(QMainWindow):
    def __init__(self, **kwargs):
        super(AbstractMainForm, self).__init__()
        self.ui_name = kwargs.get('ui_name')
        self.ui_version = kwargs.get('ui_version')

    @abstractmethod
    def closeEvent(self, event):
        """重写关闭界面的功能"""
        pass

    def openEvent(self, event):
        pass

    def get_ui_name(self):
        return str(self.ui_name)

    def get_ui_version(self):
        return str(self.ui_version)


class AbstractUiView(QWidget):
    __meta_class__ = ABCMeta

    def __init__(self, **kwargs):
        super(AbstractUiView, self).__init__()
        self.ui_name = kwargs.get('ui_name')
        self.ui_version = kwargs.get('ui_version')

    @abstractmethod
    def closeEvent(self, event):
        """重写关闭界面的功能"""
        pass

    def openEvent(self, event):
        pass

    def get_ui_name(self):
        return str(self.ui_name)

    def get_ui_version(self):
        return str(self.ui_version)



